package com.hxb.example.listener.flex;

import com.hxb.example.entity.BaseEntity;
import com.mybatisflex.annotation.UpdateListener;

import java.time.LocalDateTime;

public class MyUpdateListener implements UpdateListener {
    @Override
    public void onUpdate(Object entity) {
        if (entity instanceof BaseEntity baseEntity) {
            baseEntity.setUpdateDate(LocalDateTime.now());
        }
    }
}
